import 'package:flutter/material.dart';
import 'package:word_range_client/widgets/appInfo/AppInfoFooter.dart';
import 'package:word_range_client/widgets/appInfo/AppInfoHeader.dart';
import 'package:word_range_client/widgets/appInfo/AppInfoMenu.dart';

/// 关于APP页

class ApplicationInfo extends StatefulWidget {
  const ApplicationInfo({super.key});

  @override
  State<ApplicationInfo> createState() => _ApplicationInfoState();
}

class _ApplicationInfoState extends State<ApplicationInfo> {

  Widget _layout() {

    double width = MediaQuery.of(context).size.width;
    double height = MediaQuery.of(context).size.height;

    if(width > height){
      return const Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          AppInfoHeader(),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              AppInfoMenu(),
              AppInfoFooter(),
            ],
          )
        ],
      );
    }else{
      return const Column(
        children: [
          AppInfoHeader(),
          Expanded(child: AppInfoMenu()),
          AppInfoFooter(),
        ],
      );
    }


  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: const Text("关于APP")),
        body:  _layout()
    );
  }
}

